'use strict';

new Vue({
  el: '#root',

  data: {
    email: '',
    name: '',
    content: '',
    phone: '',
    title: '',
    alert: {
      emailAlert: false,
      phoneAlert: false,
      nameAlert: false
    }
  },

  methods: {
    onBlurInput: function onBlurInput(field) {
      this.alert[field + 'Alert'] = this[field].trim() === '';
    },
    submit: function submit() {
      var _this = this;

      ['email', 'name', 'phone'].forEach(function (item) {
        _this.alert[item + 'Alert'] = _this[item].trim() === '';
      });
    }
  }

});